What is Map Business Online SDK
Map Business Online SDK features .NET Server API. With Server API you can plot and update data in MBO from any source. The API doesn't require an application window to work with MBO and therefore can be used on a server. Create an instance of Server class to access the API's various methods.
Download and install Map Business Online SDK
Download Map Business Online SDK install package from this page: Download SDK. Run the installer and select a folder where you want to put SDK files. SDK folder has the following structure:
- Bin folder contains API .NET assemblies.
- Config folder contains API configuration file.
- Samples folder contains API usage samples.
- Map Business Online SDK.chm file is compiled HTML help that can be used offline.
Note that you need a Map Business Online account to download the SDK install package. If you don't have an account yet, please follow this link for registration:
Registration.
Getting Started with Server API
Here are the steps required to start using Map Business Online Server API.
- Create a new Console Application in Visual Studio. Note that you can use this API from server types of projects, for example, in ASP.NET Web Application.
- Add reference to the MBO.dll assembly. Choose one that corresponds to the .NET framework you use:
- .NET Framework 4.0+: <SDK install folder>\Bin\DotNet40\MBO.dll
MBO.dll depends on other assemblies from Bin folder. When you build the project they will be automatically copied to the output folder.
- Add <SDK install folder>\Config\MBO.dll.config file to the root of the project. In the file's Properties window set "Copy to Output Directory" to "Copy Always".
Note that by default MBO.dll searches for MBO.dll.config file in the same folder where the assembly is located. If you want to change that, you would need to specify the path to the config file in
Config.Path property.
- For C#. Add the following lines to the using section. Most of the API types are defined in MBO namespace, whereas main Server class is defined in MBO.Server namespace.
For Visual Basic. In the project's Properties window, on References tab find and check MBO and MBO.Server namespaces in Imported namespaces section.
- Add the following code to the Main method:
- In the code above replace "<Your MBO account e-mail>" and "<Your MBO account password>" with your real MBO user account credentials.
- Now you are ready to call Server methods. For example, you can plot some data on existing map:
Replace <placeholders> with real data. Note that map with specified name must exist in your account in My maps folder.
- Finally build and start the application. After the application has completed its work, open the map in MBO. You will see new dataset on the map! In order to update plotted dataset you can call corresponding UpdateData method.
Samples
Check out samples installed with the SDK by the following paths:
- For C#: <SDK install folder>\Samples\CS\Samples.sln
- For Visual Basic: <SDK install folder>\Samples\VB\Samples.sln
They have a lot of good stuff and demonstrate how to load application, plot data, add a circle shape, run a query of records inside the circle and finally add queried records to route.
Don't forget to replace "<Your MBO account e-mail>" and "<Your MBO account password>" in the samples' code with your real MBO user account credentials.
See Also